package com.imooc.springboot.dubbo.nilinili.consumer.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.imooc.springboot.dubbo.nilinili.service.AvatarService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
@RequestMapping("/avatar")
@Validated
public class AvatarControler {
    @Reference
    private AvatarService avatarService;

    @GetMapping("/getAll")
    public String getAll() {
        return avatarService.getAllAvatars();
    }

}
